#ifndef _TRIANGLE_LIST_
#define _TRIANGLE_LIST_

#include "triangle.h"

typedef struct _TriangleList {
	Triangle * triangles;
	long length;
} TriangleList;

TriangleList * newTriangleList();

Triangle * addTriangleToList(Triangle * list, Triangle * e);
Triangle * addAllTrianglesToList(Triangle * list, Triangle * e);
Triangle * removeTriangleFromList(Triangle * list, Triangle * e);
Triangle * removeTriangleByIndex(Triangle * list, int index);
int containsTriangleInList(Triangle * list, Triangle * e);

void printTriangleList(TriangleList * el);
void freeTriangles(Triangle * list);
void freeTriangleList(TriangleList * el);

void addTriangle(TriangleList * el, Triangle * e);
void addAllTriangles(TriangleList * el1, TriangleList * el2);
void deleteTriangle(TriangleList * el, Triangle * e);
int containsTriangle(TriangleList * el, Triangle * e);
void deleteTriangleByIndex(TriangleList * el, int index);
Triangle * getTriangle(TriangleList * tl, int idx);
int countContainedEdges(TriangleList * list, Point * a, Point * b);

#endif
